Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENHANCEMENT EmailField now uses type="email" #349

Merged
merged 2 commits into from Apr 19, 2012
Merged

ENHANCEMENT EmailField now uses type="email" #349

merged 2 commits into from Apr 19, 2012

Conversation

halkyon
Copy link
Contributor

@halkyon halkyon commented Apr 19, 2012

This has the benefit of allowing email validation in the browser, when using the required="required" attribute.
If using an old browser, the "email" type will fallback to "text" so it degrades gracefully in old browsers.

Sean Harvey added 2 commits April 19, 2012 14:06
allowing email validation when using the required="required" attribute.
If using an old browser, the "email" type will fallback to "text"
wilr added a commit that referenced this pull request Apr 19, 2012
ENHANCEMENT use type="email" for EmailField
@wilr wilr merged commit 8f4957a into silverstripe:master Apr 19, 2012
@chillu
Copy link
Member

chillu commented Apr 19, 2012

Hmmm, so by extension, we made a decision to use HTML5 by default in form fields? Because this will break validation in XHTML and HTML, right? Seems like a good default, but has broader implications than described here. On the long run, we want doctype-specific templates I guess, but too far away from that at the moment so we have to decide on one. Sean, can you add something to the upgrading docs around "Defaulting to HTML5 output for form fields", and an example on how to revert that? (through setAttribute('type', 'text'))

@wilr
Copy link
Member

wilr commented Apr 19, 2012

Well we kinda already have made the call to use HTML on the front end. DateField, GridField and I'm sure others all use HTML5 data attributes which I doubt validate.

@spierala
Copy link

it would be nice to be able to set the type of the email field without subclassing it. if you have a custom form validation then the html5 build in validation of some browsers is rather annoying

@simonwelsh
Copy link
Contributor

If you've got custom validation already, why not just use a TextField?

@spierala
Copy link

I mean the EmailField is good to have server side validation built-in. But for example if you have client side js validation then the html5 default validation is not so useful.

sabina-talipova pushed a commit to creative-commoners/silverstripe-framework that referenced this pull request Oct 18, 2022
…file-not-found

Only cache shortcode if file was found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants